#include "drivers/HTCS-driver.h"

// Note: the 9V versions give the same readings
//sensorI2CCustom = 111
//sensorI2CCustomFast = 249
//sensorI2CCustomFastSkipStates = 333
task main(){
  #define colorsensor S1
  SensorType[colorsensor] = sensorI2CCustomFastSkipStates;

  ClearTimer(T1);
	int r, g, b;
	long ticks;
	float fps;
	while(1){
	  HTCSreadRGB(colorsensor, r, g, b);

	  nxtDisplayCenteredTextLine(0, ""+r);
	  nxtDisplayCenteredTextLine(1, ""+g);
	  nxtDisplayCenteredTextLine(2, ""+b);
	  ticks++;
	  fps = (float)(ticks * 1000) / time1[T1];
	  nxtDisplayCenteredTextLine(4, ""+fps);
	}
}
